package velox.jcr.mapper;



public class MapperDefinition<T> {
	private Class<T> entityClass;
	private Mapper<T> mapper;
	private String discriminator;
	private Class<? super T> parentEntityClass;
	private boolean superclass;
	
	public MapperDefinition() {
	}
	
	public MapperDefinition(Class<T> entityClass, Mapper<T> mapper) {
		this.entityClass = entityClass;
		this.mapper = mapper;
	}
	
	public MapperDefinition(Class<T> entityClass, Mapper<T> mapper,
			Class<? super T> parentEntityClass, String discriminator) {
		this.entityClass = entityClass;
		this.mapper = mapper;
		this.parentEntityClass = parentEntityClass;
		this.discriminator = discriminator;
	}


	public String getDiscriminator() {
		return discriminator;
	}

	public void setDiscriminator(String discriminator) {
		this.discriminator = discriminator;
	}

	public Class<? super T> getParentEntityClass() {
		return parentEntityClass;
	}

	public void setParentEntityClass(Class<? super T> parentEntityClass) {
		this.parentEntityClass = parentEntityClass;
	}

	public Class<T> getEntityClass() {
		return entityClass;
	}
	
	public void setEntityClass(Class<T> entityClass) {
		this.entityClass = entityClass;
	}
	
	public Mapper<T> getMapper() {
		return mapper;
	}
	
	public void setMapper(Mapper<T> mapper) {
		this.mapper = mapper;
	}
	
	@Override
	public String toString() {
		return "MapperDefinition[" + entityClass.getName() + ", " + mapper.getClass().getName() + "]";
	}

	public void setSuperclass(boolean superclass) {
		this.superclass = superclass;
	}
	
	public boolean isSuperclass() {
		return this.superclass;
	}
}
